using System.Text.Json.Serialization;
using JlPay.Sdk.Models;
using JlPay.Sdk.Models.Trans.Dto;

namespace JlPay.Sdk.Models.Trans.Union
{
    /// <summary>
    /// 银联JS支付请求
    /// </summary>
    public class UnionJsPayRequest : OrgBaseRequest
    {
        /// <summary>
        /// API接口路径
        /// </summary>
        public const string API_URL = "/open/trans/unionjspay";
        
        /// <summary>
        /// 商户号
        /// </summary>
        [JsonPropertyName("mch_id")]
        public string MchId { get; set; } = string.Empty;

        /// <summary>
        /// 终端号
        /// </summary>
        [JsonPropertyName("term_no")]
        public string TermNo { get; set; } = string.Empty;

        /// <summary>
        /// 交易类型
        /// </summary>
        [JsonPropertyName("pay_type")]
        public string PayType { get; set; } = string.Empty;

        /// <summary>
        /// 银联支付标识
        /// </summary>
        [JsonPropertyName("app_up_identifier")]
        public string AppUpIdentifier { get; set; } = string.Empty;

        /// <summary>
        /// 用户授权码
        /// </summary>
        [JsonPropertyName("user_auth_code")]
        public string UserAuthCode { get; set; } = string.Empty;

        /// <summary>
        /// 用户标识
        /// </summary>
        [JsonPropertyName("user_id")]
        public string UserId { get; set; } = string.Empty;

        /// <summary>
        /// 商户订单号
        /// </summary>
        [JsonPropertyName("out_trade_no")]
        public string OutTradeNo { get; set; } = string.Empty;

        /// <summary>
        /// 订单有效期
        /// </summary>
        [JsonPropertyName("payment_valid_time")]
        public string PaymentValidTime { get; set; } = string.Empty;

        /// <summary>
        /// 商品标题
        /// </summary>
        [JsonPropertyName("body")]
        public string Body { get; set; } = string.Empty;

        /// <summary>
        /// 商品描述
        /// </summary>
        [JsonPropertyName("attach")]
        public string Attach { get; set; } = string.Empty;

        /// <summary>
        /// 交易金额
        /// </summary>
        [JsonPropertyName("total_fee")]
        public string TotalFee { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        [JsonPropertyName("remark")]
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 回调地址
        /// </summary>
        [JsonPropertyName("notify_url")]
        public string NotifyUrl { get; set; } = string.Empty;

        /// <summary>
        /// 操作员
        /// </summary>
        [JsonPropertyName("op_user_id")]
        public string OpUserId { get; set; } = string.Empty;

        /// <summary>
        /// 门店号
        /// </summary>
        [JsonPropertyName("op_shop_id")]
        public string OpShopId { get; set; } = string.Empty;

        /// <summary>
        /// 终端设备号
        /// </summary>
        [JsonPropertyName("device_info")]
        public string DeviceInfo { get; set; } = string.Empty;

        /// <summary>
        /// 终端IP
        /// </summary>
        [JsonPropertyName("mch_create_ip")]
        public string MchCreateIp { get; set; } = string.Empty;

        /// <summary>
        /// 经度
        /// </summary>
        [JsonPropertyName("longitude")]
        public string Longitude { get; set; } = string.Empty;

        /// <summary>
        /// 纬度
        /// </summary>
        [JsonPropertyName("latitude")]
        public string Latitude { get; set; } = string.Empty;

        /// <summary>
        /// 支付成功跳转
        /// </summary>
        [JsonPropertyName("front_url")]
        public string FrontUrl { get; set; } = string.Empty;

        /// <summary>
        /// 支付失败跳转
        /// </summary>
        [JsonPropertyName("front_fail_url")]
        public string FrontFailUrl { get; set; } = string.Empty;

        /// <summary>
        /// 二维码地址
        /// </summary>
        [JsonPropertyName("qr_code")]
        public string QrCode { get; set; } = string.Empty;

        /// <summary>
        /// 终端信息
        /// </summary>
        [JsonPropertyName("terminal_info")]
        public TerminalInfoDto? TerminalInfo { get; set; }
    }
} 